import 'package:bruno/bruno.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../AppConfig/Config.dart';
import '../../AppConfig/RouteAct.dart';
import '../../l10n/messages.dart';
import '../ProtocolDisplay.dart';

class PrivacyPolicyManagement extends StatefulWidget {
  const PrivacyPolicyManagement({super.key});

  @override
  State<PrivacyPolicyManagement> createState() => _PrivacyPolicyManagementState();
}

class _PrivacyPolicyManagementState extends State<PrivacyPolicyManagement> {
  List titleList=['用户服务协议','隐私政策','账号关联协议'];
  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    var messages = AppLocalizations.of(context)!;
    return Scaffold(
      backgroundColor: MyColors.backgreyColor,
      appBar: AppBar(
        leading: IconButton(icon: Icon(Icons.arrow_back_ios,color: Colors.black,),onPressed: (){Navigator.pop(context);},),
        title: Text(messages["隐私政策管理"],style: TextStyle(fontWeight: FontWeight.w300,fontSize: 16.sp),),
        centerTitle: true,
        backgroundColor: Colors.white,
      ),
      body:  Container(
    margin: EdgeInsets.only(top: 8.h),
    child:
      ListView.builder(
        itemCount: titleList.length,
        itemBuilder: (context, index) {
          final item = titleList[index];
          return GestureDetector(
            child:   Container(
              margin: EdgeInsets.only(bottom: 1.h),
              padding: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h,bottom: 8.h),
              color: Colors.white,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(titleList[index],style: TextStyle(color: Colors.black,fontSize: 14.sp),),
                  Icon(Icons.arrow_forward_ios,color: MyColors.authTipColor,size: 14,),
                ],
              ),

            ),
            onTap: (){
              if(index==0)
                Navigator.push( context, FadeRoute(page:ProtocolDisplay(id: "1805855164751679489",)));
              if(index==1)
                Navigator.push( context, FadeRoute(page:ProtocolDisplay(id: "1805853139653627905",)));
              if(index==2)
                Navigator.push( context, FadeRoute(page:ProtocolDisplay(id: "1805855280992620545",)));
            },
          )
          ;

        },
      ),
      ),
    );
  }
}
